package TCP;

import 英译汉.UdpEchoServer;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

public class ExtentTcp extends ExecutorTcp {
    Map<String,String>map=new HashMap<>();
    public ExtentTcp(int port) throws IOException {
        super(port);
        map.put("cat","小猫");
        map.put("dog","小狗");
        map.put("tedious","冗余的");
    }

    @Override
    public String process(String str) {
        if(map.containsKey(str)){
            return map.get(str);
        }else {
            String str1="没有这个东西";
            return str1;
        }
    }

    public static void main(String[] args) throws IOException {
        ExecutorTcp executorTcp=new ExtentTcp(9090);
        executorTcp.start();
    }
}
